package com.cdtu.stocksage.goods.service.impl;

import java.util.List;
import com.cdtu.stocksage.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cdtu.stocksage.goods.mapper.ErsWarehouseMapper;
import com.cdtu.stocksage.goods.domain.ErsWarehouse;
import com.cdtu.stocksage.goods.service.IErsWarehouseService;

/**
 * 仓库信息Service业务层处理
 * 
 * @author SL
 * @date 2025-03-12
 */
@Service
public class ErsWarehouseServiceImpl implements IErsWarehouseService 
{
    @Autowired
    private ErsWarehouseMapper ersWarehouseMapper;

    /**
     * 查询仓库信息
     * 
     * @param id 仓库信息主键
     * @return 仓库信息
     */
    @Override
    public ErsWarehouse selectErsWarehouseById(String id)
    {
        return ersWarehouseMapper.selectErsWarehouseById(id);
    }

    /**
     * 查询仓库信息列表
     * 
     * @param ersWarehouse 仓库信息
     * @return 仓库信息
     */
    @Override
    public List<ErsWarehouse> selectErsWarehouseList(ErsWarehouse ersWarehouse)
    {
        return ersWarehouseMapper.selectErsWarehouseList(ersWarehouse);
    }

    /**
     * 新增仓库信息
     * 
     * @param ersWarehouse 仓库信息
     * @return 结果
     */
    @Override
    public int insertErsWarehouse(ErsWarehouse ersWarehouse)
    {
        ersWarehouse.setCreateTime(DateUtils.getNowDate());
        return ersWarehouseMapper.insertErsWarehouse(ersWarehouse);
    }

    /**
     * 修改仓库信息
     * 
     * @param ersWarehouse 仓库信息
     * @return 结果
     */
    @Override
    public int updateErsWarehouse(ErsWarehouse ersWarehouse)
    {
        ersWarehouse.setUpdateTime(DateUtils.getNowDate());
        return ersWarehouseMapper.updateErsWarehouse(ersWarehouse);
    }

    /**
     * 批量删除仓库信息
     * 
     * @param ids 需要删除的仓库信息主键
     * @return 结果
     */
    @Override
    public int deleteErsWarehouseByIds(String[] ids)
    {
        return ersWarehouseMapper.deleteErsWarehouseByIds(ids);
    }

    /**
     * 删除仓库信息信息
     * 
     * @param id 仓库信息主键
     * @return 结果
     */
    @Override
    public int deleteErsWarehouseById(String id)
    {
        return ersWarehouseMapper.deleteErsWarehouseById(id);
    }
}
